//
//  firstCell.m
//  CoreDataAddressBook
//
//  Created by dllo on 15/11/20.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "firstCell.h"

@implementation firstCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self create];
    }
    return self;
}

- (void)create {
    self.view = [[UIView alloc] init];
//    self.view.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.view];
    

    self.nameLabel = [[UILabel alloc] init];
    self.nameLabel.backgroundColor = [UIColor grayColor];
    [self.view addSubview:self.nameLabel];
    
    self.sexLabel = [[UILabel alloc] init];
    self.sexLabel.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:self.sexLabel];
    
    self.numberLabel = [[UILabel alloc] init];
    self.numberLabel.backgroundColor = [UIColor redColor];
    [self.view addSubview:self.numberLabel];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.view.frame = CGRectMake(5, 5, self.contentView.frame.size.width - 10, self.contentView.frame.size.height - 10);
    self.nameLabel.frame = CGRectMake(5, 5, self.view.frame.size.width / 4, self.view.frame.size.height / 2 - 10);
    self.sexLabel.frame = CGRectMake(self.view.frame.size.width / 4 + 20, 5, self.view.frame.size.width / 4, self.view.frame.size.height / 2 - 10);
    self.numberLabel.frame = CGRectMake(5, self.view.frame.size.height / 2 + 5, self.view.frame.size.width / 5, self.view.frame.size.height / 2 - 10);

}




















- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
